package SGEngine2

type Transfrom struct {
	Position    Vec3
	Scale       Vec3
	EulerAngles Vec3

	LocalToWorld *Mat4
}

func (t *Transfrom) GetMat() *Mat4 {
	mat := Mat4Identity
	mat.Translation(&t.Position)
	mat.Scaling(&t.Scale)

	rmat := Mat4Identity
	rmat.RotationPitchYawRoll(t.EulerAngles.X, t.EulerAngles.Y, t.EulerAngles.Z)
	mat2 := mat.Mult(&rmat)
	return mat2
}

func (t *Transfrom) GetWorldMat() *Mat4 {
	return t.LocalToWorld.Mult(t.GetMat())
}
